const express = require('express')
const apiRouter = express.Router()
const {userInfo,department,technical,sendData,err} = require('./data/index')


apiRouter.get('/userInfo',(req,res)=>{
    const query = req.query
    sendData.data = userInfo
    res.send(sendData)
})

apiRouter.post('/department',(req,res)=>{
    const {type} = req.body
    if(!type){
        err.data = 'department发生错误，type不存在'
        throw new Error(JSON.stringify(err))
    }
    sendData.data = department
    res.send(sendData)
})





module.exports = {
    apiRouter
}